CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )

project( MeshRelaxationDeformer )

find_path( MAYA_PATH bin devkit scripts )
set( MAYA_INCLUDE_PATH "${MAYA_PATH}/include" )
set( MAYA_LIB_PATH "${MAYA_PATH}/lib" )

include_directories( "${MAYA_INCLUDE_PATH}" )
link_directories( "${MAYA_LIB_PATH}" )

add_library( MeshRelaxationDeformer SHARED LaplacianMeshSmoothing.h LaplacianMeshSmoothing.cpp MeshRelaxationDeformer.h MeshRelaxationDeformer.cpp MeshSmoothing.h MeshSmoothing.cpp TaubinMeshSmoothing.h TaubinMeshSmoothing.cpp BilateralMeshSmoothing.h BilateralMeshSmoothing.cpp AEmeshRelaxationTemplate.mel )

target_link_libraries( MeshRelaxationDeformer Foundation OpenMaya OpenMayaAnim OpenMayaUI )

if( MSVC )
	add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS )
	add_definitions( -D_SECURE_SCL=0 )
	add_definitions( -DWINDOWS -D_WINDOWS -DNOMINMAX )
	add_definitions(-DNT_PLUGIN )
	set_target_properties( MeshRelaxationDeformer PROPERTIES SUFFIX ".mll" )
else()
	add_definitions( -Dlinux )
	set_target_properties( MeshRelaxationDeformer PROPERTIES PREFIX "" )
endif()

add_definitions( -DREQUIRE_IOSTREAM -D_BOOL )